package com.projects.android.views;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.widget.Button;
import android.widget.EditText;

import com.projects.android.R;

public class Configuration extends Dialog {
	private Button btnSave;
	private EditText txtServerAddress;
	private String URL;

	public Configuration(Context context, String uri) {
		super(context);
		URL = uri;
	}

	// Use an existing ListAdapter that will map an array
	// of strings to TextViews
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.configuration);
		initFrm();
	}

	private void initFrm() {
		btnSave = (Button) findViewById(R.id.btnAddServer);
		txtServerAddress = (EditText) findViewById(R.id.txtServerAddress);
		txtServerAddress.setText(URL);
	}

	public void setBtnSave(Button btnSave) {
		this.btnSave = btnSave;
	}

	public Button getBtnSave() {
		return btnSave;
	}

	public EditText getTxtServerAddress() {
		return txtServerAddress;
	}

	public void setTxtServerAddress(String text) {
		this.txtServerAddress.setText(text);
	}
}
